﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Admin.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<Hotnet.Entity.VideoChild>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	列表
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	
	<div>
		<a style="float:right" href="/AdminVideoGroup/CreateGroupVideo/?groupID=<%=ViewData["GroupID"] %>">创建视频</a>
		<div style=" margin:5px 0px 3px 0px;">
			<span style="color:Red">
				所在位置:
			</span>
			<a href="/AdminVideoGroup/Index/?categoryID=<%=ViewData["CategoryID"] %>" style=" text-decoration:none;">
				<%=ViewData["CategoryName"] %>
			</a>
			->
			视频组:<%=ViewData["GroupName"] %>
		</div>
	</div>
	<div class="divDot"></div>
	<ul>
	<% foreach (var item in Model)
		{ %>
			<li class="videoli">
				<img src="<%=item.CoverImagePath %>"" />
				<div>
					<%=item.Name %>
				</div>
				<div>
					<a href="/AdminVideoGroup/EditGroupVideo/<%=item.VideoID %>">编辑</a>
					<a href="javascript:deleteGroupVideo(<%=item.VideoID %>)">删除</a>
					<a href="javascript:preview('<%=item.VideoSrc %>')">预览</a>
				</div>
			</li>
		<%} %>
	</ul>
	
	<div id="flashPreview" style="display:none;">
		
	</div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
	
	<script type="text/javascript">
		var flashBoxy;
		var flashCodePart1 = "<embed src='";
		var flashCodePart2 = "' id='flashEmbed'"
							+ "'quality='high' width='480' height='400' align='middle' allowScriptAccess='sameDomain' type='application/x-shockwave-flash'>'"
							+ "</embed>";

		function preview(videoSrc) {
			var flashCode = flashCodePart1 + videoSrc + flashCodePart2;
			$("#flashPreview").html(flashCode);
			if (flashBoxy == null)
				flashBoxy = new Boxy($('#flashPreview'), { modal: false, title: '视频预览', closeText: '[×]', draggable: true });
			else
				flashBoxy.show();
		}

		function deleteGroupVideo(id) {
			if (!confirm("确认删除视频?"))
				return;
			$.post("/AdminVideoGroup/DeleteGroupVideo/" + id,
				function(data) {
			if (data.toUpperCase() == "TRUE")
						alert("删除成功！");
					window.location.href = window.location.href;
				});
		}
	
	
	</script>

</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="StyleContent" runat="server">

	<style type="text/css">
		.videoli
		{
			 float:left;
			 list-style-type:none;
			 width:140px;
		}
		.videoli img
		{
			width:120px;
			height:90px;
			margin:5px 5px 2px 10px;
			border:1px solid #ececec;
			padding:3px;
		}
		.videoli div
		{
			text-align:center;
			overflow:hidden;
			height:20px;
		}
		
			.divDot
			{
				border-bottom:1px solid gray; 
				border-bottom-style:dotted;
				margin:8px 0px 8px 0px;
			}
	
	</style>
</asp:Content>

